package com.huajin.codetest.jol;

import org.openjdk.jol.info.ClassLayout;

/**
 * https://zhuanlan.zhihu.com/p/127884116
 * https://blog.csdn.net/qq_28773223/article/details/109706667
 * https://juejin.cn/post/7046921350065160206
 * 
 * 引入jol依赖
 * compile ('org.openjdk.jol:jol-core:0.9')
 */
public class ObjectTest {
	
	public static void main(String[] args) throws InterruptedException {
		//TimeUnit.SECONDS.sleep(5);
		Object object = new Object();
        System.out.println(ClassLayout.parseInstance(object).toPrintable());
        System.out.println("=====================================");
        synchronized (object) {
            System.out.println(ClassLayout.parseInstance(object).toPrintable());
        }
	}

}
